package cn.wolfcode.luowowo.article.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class TravelQuery extends QueryObject{

    private Long destId = -1L;
    private int dayType = -1;
    private int travelTimeType = -1;
    private int perExpendType = -1;

    public TravelCondition getDay(){
        return TravelCondition.dayMap.get(dayType);
    }

    public TravelCondition getTravelTime(){
        return TravelCondition.travelTimeMap.get(travelTimeType);
    }

    public TravelCondition getPerExpend(){
        return TravelCondition.perExpendMap.get(perExpendType);
    }

    private int orderType = 1;

    public String getOrderBy(){
        return orderType == 1 ? "t.createTime desc" : "t.viewnum desc";
    }



}
